<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>globalScaleRatio</title>
    <script src="../dist/quark-renderer.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style>
        html, body, #main {
            width: 100%;
            height: 100%;
        }
        #global-scale-ratio {
            position: absolute;
            left: 10px;
            top: 10px;
            width: 100px;
        }
    </style>
</head>
<body>
    <div id="main"></div>
    <input type="range" id="global-scale-ratio" min="0" max="2" value="1" step="0.1">
    <script type="text/javascript">
        let main = document.getElementById('main');
        let qr = QuarkRenderer.init(main);

        let circle = new QuarkRenderer.Circle({
            position: [300, 300],
            scale: [1, 1],
            shape: {
                cx: 0,
                cy: 0,
                r: 50
            },
            style: {
                fill:{
                    type:'linear',
                    colorStops:[
                        {offset:0,color:'red'},
                        {offset:1,color:'black'}
                    ]
                },
                lineWidth: 5,
                text:'circle',
                textPosition:'inside'
            }
        });
        qr.add(circle);

        circle.animate()
            .when(1000, {
                scale: [3, 3]
            })
            .when(2000, {
                scale: [1, 1]
            })
            .start(true);

        document.getElementById('global-scale-ratio').addEventListener('change', function (e) {
            circle.globalScaleRatio = this.value;
        });
    </script>
</body>
</html>